﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master"
 Inherits="System.Web.Mvc.ViewPage<IntellectShop.Web2.ViewModels.CategoryBrowseSoftwareViewModel>" %>
<%@ Import Namespace="IntellectShop.Web2.Code" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%= Html.Resource("BrowsingCategory") %>: <%= Html.Encode(Model.Category.Name) %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
	<script type="text/javascript" src='<%= ResolveUrl("~/Scripts/live.filter.1.2/jquery.liveFilter.min.js")%>'></script>
	<script type="text/javascript">
		$(document).ready(function () {
			$('table.live_filter').liveFilter('fade');
		});
	</script>

	<h1><%= Html.Resource("BrowsingCategory") %>: <%= Html.Encode(Model.Category.Name) %></h1>
	<div class="innerArticle">
		<% Html.RenderAction("ViewBody", "PageContent", new { pageContentUniqName = IntellectShop.Common.PageContentUniqName.SoftwareBrowse }); %>
	</div>
	<% if (Model.Softwares.Any())
	{ %>
	<p>
		<%= Html.Resource("Strings, LiveSearch") %>:
		<input class="filter" name="livefilter" type="text" value="" />
	</p>
	<table class="live_filter hovered">
		<thead>
			<tr>
				<th>
					<%= Html.LabelFor(model => model.Softwares.First().Code)%>
				</th>
				<th>
					<%= Html.LabelFor(model => model.Softwares.First().Name)%>
				</th>
				<th>
					<%= Html.LabelFor(model => model.Softwares.First().Price)%>
				</th>
			</tr>
		</thead>
		<tbody>
			<% foreach (var each in Model.Softwares)
			{ %>
			<tr class="clickable"
				onclick='javascript: document.location.href = $("td strong a", $(this)).attr("href"); return false;'>
				<td style="text-align: right; white-space:nowrap;">
					<strong>
					<%= Html.ActionLink(
							each.Code,
							"Details", "Software",
							new { id = each.CommodityID }, null)%>
					</strong>
				</td>
				<td>
					<a name="id<%= each.CommodityID %>"></a>
					<%= each.ToString() %>
				</td>
				<td style="white-space:nowrap; text-align: right;">
					<%= each.Price.ToString() %>
				</td>
			</tr>
			<% } %>
		</tbody>
	</table>
	<% } %>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="SecondInfo" runat="server">
<div class="sidebaritem">
	<% Html.RenderPartial("SubmenuStore"); %>
</div>
</asp:Content>
